package main

import (
	"fmt"
)

func main() {
	slice := []int{0, 1, 2, 3}
	m := make(map[int]*int)
	// test 1
	for k, v := range slice {
		m[k] = &v
	}
	for key, value := range m {
		fmt.Printf("map[%v]=%v\n", key, *value)
	}
	// test 2
	for _, v := range slice {
		if v == 0 {
			v = 100
		}
	}
	for k, v := range slice {
		fmt.Println("k:", k, "v:", v)
	}
}
